﻿using System.Diagnostics.Contracts;

namespace DaveSexton.Labs
{
	internal sealed class InputAcquirer<T> : InputAcquirer
	{
		#region Public Properties
		[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1500:VariableNamesShouldNotMatchFieldNames", MessageId = "value",
			Justification = "Implicit parameter name - usage is not confusing.")]
		public T Value
		{
			get
			{
				Contract.Requires(HasValue);

				return value;
			}
			set
			{
				Contract.Requires(!HasValue);
				Contract.Ensures(HasValue);

				this.value = value;

				SetHasValue();
			}
		}
		#endregion

		#region Private / Protected
		private T value;
		#endregion

		#region Constructors
		/// <summary>
		/// Constructs a new instance of the <see cref="InputAcquirer{T}" /> class.
		/// </summary>
		public InputAcquirer()
		{
		}
		#endregion

		#region Methods
		#endregion
	}
}